package com.cqjtu.store.user.mapper;

import com.cqjtu.store.user.pojo.dto.UserPageDTO;
import com.cqjtu.store.user.pojo.entity.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository //持久层
public interface UserMapper {
    /**
     * 新增用户
     * @param user
     * @return
     */
    int insert(User user);

    User getUserByName(String username);

    /**
     * 修改密码
     * @param updateUser
     * @return
     */
    int updatePwd(User updateUser);

    int updateUser(User user);

    int saveAvatar(User user);
    int addUser(User user);
    /**
     * 根据编号查询用户
     * @param id
     * @return
     */
    User getById(Integer id);
    int stopOrStartUser(User user);
    int resetUser(User user);
    List<User> showUserList(@Param("userPageDTO") UserPageDTO userPageDTO);
    List<User> showUserByNameList(@Param("username") String username,@Param("userPageDTO") UserPageDTO userPageDTO);
    int count();
    int countByName(String username);

}
